//
//  LGPatientDetailFollowCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2024/11/4.
//

#import "LGPatientDetailFollowCell.h"

@interface LGPatientDetailFollowCell()
/**   */
@property (nonatomic , strong)UIImageView *iconView;
/**   */
@property (nonatomic , strong)UILabel *timeLabel;
/**   */
@property (nonatomic , strong)UILabel *doctorLabel;
/**   */
@property (nonatomic , strong)UILabel *contentLabel;

@end

@implementation LGPatientDetailFollowCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.type = LGPositionTypeMiddle;
        [self createSubView];
    }
    return  self;
}

-(void)setDataDic:(NSDictionary *)dataDic{
    [super setDataDic:dataDic];
    self.timeLabel.text = LGNSString(dataDic[@"create_time"]);
    self.doctorLabel.text = LGNSString(dataDic[@"operatorname"]);
    self.contentLabel.text = LGNSString(dataDic[@"content"]);
}


-(void)createSubView{
    [self.contentView addSubview:self.iconView];
    [self.contentView addSubview:self.timeLabel];
    [self.contentView addSubview:self.doctorLabel];
    [self.contentView addSubview:self.contentLabel];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconView.mas_right).offset(viewPix(3));
        make.centerY.equalTo(self.iconView);
    }];
    [self.doctorLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-viewPix(28));
        make.centerY.equalTo(self.iconView);
    }];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.iconView.mas_bottom).offset(viewPix(10));
        make.left.equalTo(self.iconView);
        make.right.equalTo(self.doctorLabel);
        make.bottom.equalTo(self.contentView).offset(-viewPix(8));
    }];
}

-(UIImageView *)iconView{
    if(!_iconView){
        _iconView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"患者档案-随访记录"]];
        _iconView.frame = CGRectMake(viewPix(28), viewPix(10), viewPix(16), viewPix(16));
    }
    return _iconView;
}

-(UILabel *)timeLabel{
    if(!_timeLabel){
        _timeLabel = [UILabel lableWithText:@"" colorString:@"#909399" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _timeLabel;
}

-(UILabel *)doctorLabel{
    if(!_doctorLabel){
        _doctorLabel = [UILabel lableWithText:@"" colorString:@"#282828" textFont:LGFont(16) textAlignment:NSTextAlignmentRight lines:1];
    }
    return _doctorLabel;
}

-(UILabel *)contentLabel{
    if(!_contentLabel){
        _contentLabel = [UILabel lableWithText:@"" colorString:@"#282828" textFont:LGFont(16) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _contentLabel;
}

@end
